package com.ffcs.crmd.tsp.api.client;

import com.ffcs.crmd.tsp.api.dto.client.TspCluster;
import com.ffcs.crmd.tsp.api.dto.client.TspClusterInstance;
import com.ffcs.crmd.tsp.api.dto.client.TspJob;
import com.ffcs.crmd.tsp.api.dto.client.TspJobDetail;
import com.ffcs.crmd.tsp.api.dto.client.TspJobDetailDeath;
import com.ffcs.crmd.tsp.api.dto.client.TspJobDetailParam;
import com.ffcs.crmd.tsp.api.dto.client.TspJobDetailRetry;
import com.ffcs.crmd.tsp.api.dto.client.TspJobDetailRunning;
import com.ffcs.crmd.tsp.api.dto.client.TspJobDetailThreadInfo;
import com.ffcs.crmd.tsp.api.dto.client.TspJobDetailTrack;
import com.ffcs.crmd.tsp.api.dto.client.TspJobDetailWaiting;
import com.ffcs.crmd.tsp.api.dto.client.TspJobGroup;
import com.ffcs.crmd.tsp.api.dto.client.TspJobIdentityInfo;
import com.ffcs.crmd.tsp.api.dto.client.TspResult;
import com.ffcs.crmd.tsp.api.dto.client.TspSlice;
import com.ffcs.crmd.tsp.api.dto.client.TspSliceGroup;
import com.ffcs.crmd.tsp.api.dto.client.TspTaskConnectInfo;
import com.ffcs.crmd.tsp.api.dto.client.TspTaskIdentity;
import com.ffcs.crmd.tsp.common.enu.ServiceState;
import com.ffcs.crmd.tsp.common.exception.TspException;
import com.ffcs.crmd.tsp.common.exception.TspRemotingException;

/**
 * 
 * 功能说明:客户端接口
 *
 * @author ZHONGFUHUA
 * 
 * @since 1.0.0-SNAPSHOT
 *
 */
public interface IClient {
    
    /**
     * 功能说明:
     * 
     * @param request
     * @return
     */
    TspResult<?> createJob(TspJob request);
    
    /**
     * 功能说明:
     * 
     * @param request
     * @return
     */
    TspResult<?> createJobDetail(TspJobDetail request);

    /**
     * 功能说明:
     * 
     * @param request
     * @return
     */
    TspResult<?> createJobDetailParam(TspJobDetailParam request);
    
    /**
     * 功能说明:
     * 
     * @param request
     * @return
     */
    TspResult<?> createJobGroup(TspJobGroup request);

    /**
     * 功能说明:
     * 
     * @param request
     * @return
     */
    TspResult<?> createJobIdentityInfo(TspJobIdentityInfo request);

    /**
     * 功能说明:
     * 
     * @param request
     * @return
     */
    TspResult<?> createSlice(TspSlice request);

    /**
     * 功能说明:
     * 
     * @param request
     * @return
     */
    TspResult<?> createSliceGroup(TspSliceGroup request);

    /**
     * 功能说明:
     * 
     * @param request
     * @return
     */
    TspResult<?> createTaskIdentity(TspTaskIdentity request);

    /**
     * 功能说明:
     * 
     * @param request
     * @return
     */
    TspResult<?> deleteJob(TspJob request);

    /**
     * 功能说明:
     * 
     * @param request
     * @return
     */
    TspResult<?> deleteJobDetail(TspJobDetail request);

    /**
     * 功能说明:
     * 
     * @param request
     * @return
     */
    TspResult<?> deleteJobDetailDeath(TspJobDetailDeath request);

    /**
     * 功能说明:
     * 
     * @param request
     * @return
     */
    TspResult<?> deleteJobDetailParam(TspJobDetailParam request);

    /**
     * 功能说明:
     * 
     * @param request
     * @return
     */
    TspResult<?> deleteJobDetailRunning(TspJobDetailRunning request);

    /**
     * 功能说明:
     * 
     * @param request
     * @return
     */
    TspResult<?> deleteJobGroup(TspJobGroup request);

    /**
     * 功能说明:
     * 
     * @param request
     * @return
     */
    TspResult<?> deleteJobIdentityInfo(TspJobIdentityInfo request);

    /**
     * 功能说明:
     * 
     * @param request
     * @return
     */
    TspResult<?> deleteSlice(TspSlice request);

    /**
     * 功能说明:
     * 
     * @param request
     * @return
     */
    TspResult<?> deleteSliceGroup(TspSliceGroup request);

    /**
     * 功能说明:
     * 
     * @param request
     * @return
     */
    TspResult<?> deleteTaskIdentity(TspTaskIdentity request);

    /**
     * 功能说明:
     * 
     * @return
     */
    int getCallbackExecutorThreads();

    /**
     * 功能说明:
     * 
     * @return
     */
    long getConnectTimeoutMillis();

    /**
     * 功能说明:
     * 
     * @return
     */
    long getHeartbeatBrokerInterval();

    /**
     * 功能说明:
     * 
     * @return
     */
    int getListenPort();

    /**
     * 功能说明:
     * 
     * @return
     */
    int getPermitsAsync();

    /**
     * 功能说明:
     * 
     * @return
     */
    int getPermitsOneway();

    /**
     * 功能说明:
     * 
     * @return
     */
    int getProcessorExecutorThreads();

    /**
     * 功能说明:
     * 
     * @return
     */
    long getSendTimeout();

    /**
     * 功能说明:
     * 
     * @return
     */
    String getServerAddr();

    /**
     * 功能说明:
     * 
     * @return
     */
    ServiceState getServiceState();

    /**
     * 功能说明:
     * 
     * @return
     */
    int getWorkGroupThreads();

    /**
     * 功能说明:
     * 
     * @param request
     * @return
     */
    TspResult<?> interruptJob(TspJobDetailRunning request);

    /**
     * 功能说明:
     * 
     * @param request
     * @return
     */
    TspResult<?> pauseJob(TspJob request);

    /**
     * 功能说明:
     * 
     * @param request
     * @return
     */
    TspResult<?> pauseJobDetail(TspJobDetail request);

    /**
     * 功能说明:
     * 
     * @param request
     * @return
     */
    TspResult<?> pauseJobGroup(TspJobGroup request);

    /**
     * 功能说明:
     * 
     * @param request
     * @return
     */
    TspResult<TspCluster> queryCluster(TspCluster request);

    /**
     * 功能说明:
     * 
     * @param request
     * @return
     */
    TspResult<TspClusterInstance> queryClusterInstance(TspClusterInstance request);

    /**
     * 功能说明:
     * 
     * @param request
     * @return
     */
    TspResult<TspJob> queryJob(TspJob request);

    /**
     * 功能说明:
     * 
     * @param request
     * @return
     */
    TspResult<TspJobDetail> queryJobDetail(TspJobDetail request);

    /**
     * 功能说明:
     * 
     * @param request
     * @return
     */
    TspResult<TspJobDetailDeath> queryJobDetailDeath(TspJobDetailDeath request);

    /**
     * 功能说明:
     * 
     * @param request
     * @return
     */
    TspResult<TspJobDetailParam> queryJobDetailParam(TspJobDetailParam request);

    /**
     * 功能说明:
     * 
     * @param request
     * @return
     */
    TspResult<TspJobDetailRetry> queryJobDetailRetry(TspJobDetailRetry request);

    /**
     * 功能说明:
     * 
     * @param request
     * @return
     */
    TspResult<TspJobDetailRunning> queryJobDetailRunning(TspJobDetailRunning request);

    /**
     * 功能说明:
     * 
     * @param request
     * @return
     */
    TspResult<TspJobDetailThreadInfo> queryJobDetailThreadInfo(TspJobDetailRunning request);

    /**
     * 功能说明:
     * 
     * @param request
     * @return
     */
    TspResult<TspJobDetailTrack> queryJobDetailTrack(TspJobDetailTrack request);

    /**
     * 功能说明:
     * 
     * @param request
     * @return
     */
    TspResult<TspJobDetailWaiting> queryJobDetailWaiting(TspJobDetailWaiting request);

    /**
     * 功能说明:
     * 
     * @param request
     * @return
     */
    TspResult<TspJobGroup> queryJobGroup(TspJobGroup request);

    /**
     * 功能说明:
     * 
     * @param request
     * @return
     */
    TspResult<TspJobIdentityInfo> queryJobIdentityInfo(TspJobIdentityInfo request);

    /**
     * 功能说明:
     * 
     * @param request
     * @return
     */
    TspResult<TspSlice> querySlice(TspSlice request);

    /**
     * 功能说明:
     * 
     * @param request
     * @return
     */
    TspResult<TspSliceGroup> querySliceGroup(TspSliceGroup request);

    /**
     * 功能说明:
     * 
     * @param request
     * @return
     */
    TspResult<TspTaskConnectInfo> queryTaskConnectInfo(TspTaskConnectInfo request);

    /**
     * 功能说明:
     * 
     * @param request
     * @return
     */
    TspResult<TspTaskIdentity> queryTaskIdentity(TspTaskIdentity request);

    /**
     * 功能说明:
     * 
     * @param request
     * @return
     */
    TspResult<?> resetJobDetailDeath(TspJobDetailDeath request);

    /**
     * 功能说明:
     * 
     * @param request
     * @return
     */
    TspResult<?> resetJobDetailRunning(TspJobDetailRunning request);

    /**
     * 功能说明:
     * 
     * @param request
     * @return
     */
    TspResult<?> resumeJob(TspJob request);

    /**
     * 功能说明:
     * 
     * @param request
     * @return
     */
    TspResult<?> resumeJobDetail(TspJobDetail request);

    /**
     * 功能说明:
     * 
     * @param request
     * @return
     */
    TspResult<?> resumeJobGroup(TspJobGroup request);

    /**
     * 功能说明:
     * 
     * @param callbackExecutorThreads
     */
    void setCallbackExecutorThreads(int callbackExecutorThreads);

    /**
     * 功能说明:
     * 
     * @param connectTimeoutMillis
     */
    void setConnectTimeoutMillis(long connectTimeoutMillis);

    /**
     * 功能说明:
     * 
     * @param heartbeatBrokerInterval
     */
    void setHeartbeatBrokerInterval(long heartbeatBrokerInterval);

    /**
     * 功能说明:
     * 
     * @param listenPort
     */
    void setListenPort(int listenPort);

    /**
     * 功能说明:
     * 
     * @param permitsAsync
     */
    void setPermitsAsync(int permitsAsync);

    /**
     * 功能说明:
     * 
     * @param permitsOneway
     */
    void setPermitsOneway(int permitsOneway);

    /**
     * 功能说明:
     * 
     * @param processorExecutorThreads
     */
    void setProcessorExecutorThreads(int processorExecutorThreads);

    /**
     * 功能说明:
     * 
     * @param sendTimeout
     */
    void setSendTimeout(long sendTimeout);

    /**
     * 功能说明:
     * 
     * @param serverAddr
     */
    void setServerAddr(String serverAddr);

    /**
     * 功能说明:
     * 
     * @param serviceState
     */
    void setServiceState(ServiceState serviceState);

    /**
     * 功能说明:
     * 
     * @param workGroupThreads
     */
    void setWorkGroupThreads(int workGroupThreads);

    /**
     * 
     * 功能说明:客户端关闭
     * 
     * @throws TspException 
     */
    public void shutdown() throws TspException;

    /**
     * 
     * 功能说明:启动客户端
     * 
     * @throws TspRemotingException
     */
    public void start() throws TspException;

    /**
     * 功能说明:
     * 
     * @param request
     * @return
     */
    TspResult<?> updateJob(TspJob request);

    /**
     * 功能说明:
     * 
     * @param request
     * @return
     */
    TspResult<?> updateJobDetailParam(TspJobDetailParam request);

    /**
     * 功能说明:
     * 
     * @param request
     * @return
     */
    TspResult<?> updateJobGroup(TspJobGroup request);

    /**
     * 功能说明:
     * 
     * @param serverAddr
     */
    void updateServerAddr(String serverAddr);

    /**
     * 功能说明:
     * 
     * @param request
     * @return
     */
    TspResult<?> updateSlice(TspSlice request);

    /**
     * 功能说明:
     * 
     * @param request
     * @return
     */
    TspResult<?> updateSliceGroup(TspSliceGroup request);

    /**
     * 功能说明:
     * 
     * @param request
     * @return
     */
    TspResult<?> updateTaskIdentity(TspTaskIdentity request);
    
}
